<template>
  <div id="client">
    <div class="client-top">
      <el-select v-model="value" placeholder="请选择供应商类别">
        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
        </el-option>
      </el-select>
      <el-input style="width: 240px;margin-left: 10px;margin-right: 20px;" placeholder="请输入供应商编号" v-model="input"
        clearable>
      </el-input>
      <el-button type="primary">查询</el-button>
      <el-button type="primary" @click="dialogFormVisible = true">新增</el-button>
      <el-button type="primary">导入</el-button>
      <el-button type="primary">导出</el-button>
    </div>
    <div class="client-content">
      <el-table height="500px" :data="tableData" border style="width: 100%;font-size: 13px;">
        <el-table-column type="selection" width="55">
        </el-table-column>
        <el-table-column fixed prop="date" label="供应商编号" width="150">
        </el-table-column>
        <el-table-column prop="name" label="供应商名称" width="120">
        </el-table-column>
        <el-table-column prop="province" label="供应商类别" width="120">
        </el-table-column>
        <el-table-column prop="city" label="期初应付款" width="120">
        </el-table-column>
        <el-table-column prop="address" label="期初预付款" width="300">
        </el-table-column>
        <el-table-column prop="zip" label="开户银行" width="120">
        </el-table-column>
        <el-table-column prop="city" label="银行账号" width="120">
        </el-table-column>
        <el-table-column prop="address" label="交货方式" width="300">
        </el-table-column>
        <el-table-column prop="zip" label="是否物流公司" width="120">
        </el-table-column>
        <el-table-column prop="zip" label="业务员" width="120">
        </el-table-column>
        <el-table-column prop="city" label="联系人" width="120">
        </el-table-column>
        <el-table-column prop="address" label="电话" width="300">
        </el-table-column>
        <el-table-column prop="city" label="邮箱" width="120">
        </el-table-column>
        <el-table-column prop="address" label="联系地址" width="300">
        </el-table-column>
        <el-table-column prop="zip" label="是否启用" width="120">
          <template slot-scope="scope">
            <el-switch v-model="scope.row.zip" active-color="#66b1ff" inactive-color="#c1c1c1" active-value="200333"
              inactive-value="0">
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="100">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
            <el-button type="text" size="small">编辑</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination style="position: absolute;left: 700px;" @size-change="handleSizeChange"
        @current-change="handleCurrentChange" :current-page="currentPage4" :page-sizes="[100, 200, 300, 400]"
        :page-size="100" layout="total, sizes, prev, pager, next, jumper" :total="400">
      </el-pagination>
    </div>
    <el-dialog top="20px" title="新增供应商" :visible.sync="dialogFormVisible">
      <AddProvider />
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import AddProvider from './AddProvider.vue';

export default {
  name: 'Provider',
  data() {
    return {
      dialogFormVisible: false,
      switchValue: '1',
      options: [{
        value: '选项1',
        label: '黄金糕'
      }, {
        value: '选项2',
        label: '双皮奶'
      }, {
        value: '选项3',
        label: '蚵仔煎'
      }, {
        value: '选项4',
        label: '龙须面'
      }, {
        value: '选项5',
        label: '北京烤鸭'
      }],
      value: '',
      input: '',
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        province: '上海',
        city: '普陀区',
        address: '上海市普陀区金沙江路 1518 弄',
        zip: '200333'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        province: '上海',
        city: '普陀区',
        address: '上海市普陀区金沙江路 1517 弄',
        zip: '200333'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        province: '上海',
        city: '普陀区',
        address: '上海市普陀区金沙江路 1519 弄',
        zip: '200333'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        province: '上海',
        city: '普陀区',
        address: '上海市普陀区金沙江路 1516 弄',
        zip: '200333'
      }]
    }
  },
  components: {
    AddProvider
  }
}
</script>

<style scoped>
#client {
  width: 100%;
  height: 100%;
}

.client-top {
  width: calc(100% -20px);
  height: 60px;
  /* background-color: pink; */
  line-height: 60px;
  padding-left: 20px;
  font-size: 13px;
}

.client-content {
  width: 100%;
  height: calc(100% - 60px);
  /* background-color: skyblue; */
}

.el-input,
.el-button {
  font-size: 13px;
}
</style>